<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><title>Audio Processor - NewAC</title><link rel="stylesheet" type="text/css" href="../../../../styles/main.css"><script language=JavaScript src="../../../../javascript/main.js"></script><script language=JavaScript src="../../../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CSection"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="Audio_Processor"></a>Audio Processor</h1><div class=CBody><p>This demo converts stereo to mono.&nbsp; If the input is mono it is left as is, if the input is stereo it is converted to mono.</p><ul><li>This demo accepts 16 bps input.</li><li>In order to use AudioProcessor component you should set its OnGeData event handler at least.</li><li>In this demo we also set OnGetChannels event handler.</li><li>Don&rsquo;t forget to assign WaveIn1&rsquo;s FileName property.</li></ul><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#Audio_Processor" >Audio Processor</a></td><td class=SDescription>This demo converts stereo to mono. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FormClose" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">FormClose</a></td><td class=SDescription>This OnClose event prevents exceptions if he form is closed while playing.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#Buffers" >Buffers</a></td><td class=SDescription>We assume the input is 16 bits per sample.</td></tr><tr class="SGeneric SIndent2"><td class=SEntry><a href="#Get_Data" >Get Data</a></td><td class=SDescription>A all to Input.GetData(Buffer, Bytes) retrieves a part of the input component&rsquo;s buffer (pointed to by Buffer) that contains The number of bytes returned in Bytes.</td></tr><tr class="SGeneric SIndent2 SMarked"><td class=SEntry><a href="#FillBuffer" >FillBuffer</a></td><td class=SDescription>EndOfInput is set to True when FillBuffer has encountered the end of data in AudioProcessor1.Input. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormClose"></a>FormClose</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>procedure TForm1.FormClose(</td><td class=PParameter nowrap>Sender:</td><td class=PType nowrap>&nbsp;TObject;</td></tr><tr><td></td><td class=PParameter nowrap>var Action:</td><td class=PType nowrap>&nbsp;TCloseAction</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>This OnClose event prevents exceptions if he form is closed while playing.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Buffers"></a>Buffers</h3><div class=CBody><p>We assume the input is 16 bits per sample.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="PS16:PStereoBuffer16"></a>PS16: PStereoBuffer16</td><td class=CDLDescription>pointer to a buffer for stereo data</td></tr><tr><td class=CDLEntry><a name="P16:PBuffer16"></a>P16: PBuffer16</td><td class=CDLDescription>pointer to a buffer for mono data.</td></tr></table></div></div></div>

<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Get_Data"></a>Get Data</h3><div class=CBody><p>A all to Input.GetData(Buffer, Bytes) retrieves a part of the input component&rsquo;s buffer (pointed to by Buffer) that contains The number of bytes returned in Bytes.</p><p>See the <a href="../../../doc/txt/cwguide-txt.html#Component_Writer's_Guide" class=LSection id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">Component Writer&rsquo;s Guide</a> on more detail about how GetData() operates.</p></div></div></div>

<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="FillBuffer"></a>FillBuffer</h3><div class=CBody><p>EndOfInput is set to True when FillBuffer has encountered the end of data in AudioProcessor1.Input.&nbsp; There still may be some data in the input, but the next time this method is called we should return nil.</p></div></div></div>

</div><!--Content-->


<div id=Footer>Content &copy; 2008-2010 Andrei Borovsky. Design &copy; 2008 Wayne Thursby. <b><u><a href="http://symmetrica.net/newac">Go to the project's main page</a></u></b>&nbsp; &middot;&nbsp; <a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MTitle>NewAC<div class=MSubTitle>v2.6.1</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Documentation</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="../../../doc/txt/introduction-txt.html">Quick Introduction to NewAC</a></div></div><div class=MEntry><div class=MFile><a href="../../../doc/txt/about_documentation-txt.html">About the Documentation</a></div></div><div class=MEntry><div class=MFile><a href="../../../doc/txt/cwguide-txt.html">Component Writer&rsquo;s Guide</a></div></div><div class=MEntry><div class=MFile><a href="../../../doc/txt/license-txt.html">License</a></div></div><div class=MEntry><div class=MFile><a href="../../../doc/txt/tips_and_tricks-txt.html">Tips &amp; Tricks</a></div></div><div class=MEntry><div class=MFile><a href="../../../doc/txt/newac-txt.html">About New Audio Components</a></div></div><div class=MEntry><div class=MFile><a href="../../../doc/txt/features-txt.html">NewAC Main Features List</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Main Units</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="../../../src/ACS_AudioMix-pas.html">ACS_AudioMix</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_CDROM-pas.html">ACS_CDROM</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_Classes-pas.html">ACS_Classes</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_Converters-pas.html">ACS_Converters</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_DXAudio-pas.html">ACS_DXAudio</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_FLAC-pas.html">ACS_FLAC</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_Filters-pas.html">ACS_Filters</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_LAME-pas.html">ACS_LAME</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_MAC-pas.html">ACS_MAC</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_Misc-pas.html">ACS_Misc</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_MPC-pas.html">ACS_MPC</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_OptimFROG-pas.html">ACS_OptimFROG</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_smpeg-pas.html">ACS_SMPEG</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_Streams-pas.html">ACS_Streams</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_TTA-pas.html">ACS_TTA</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_Tags-pas.html">ACS_Tags</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_Vorbis-pas.html">ACS_Vorbis</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_WavPack-pas.html">ACS_WavPack</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_Wave-pas.html">ACS_Wave</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_WinMedia-pas.html">ACS_WinMedia</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_AAC-pas.html">ACS_AAC</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/AudioDMO-pas.html">AudioDMO</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/AudioPass-pas.html">AudioPass</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/AuSampleRate-pas.html">AuSampleRate</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/AuASIO-pas.html">AuASIO</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/AuSynch-pas.html">AuSynch</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/NewACDTS-pas.html">NewACDTS</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/NewAC_AVI-pas.html">NewAC_AVI</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/NewAC_DSP-pas.html">NewAC_DSP</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/NewACAC3-pas.html">NewACAC3</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/NewACIndicators-pas.html">NewACIndicators</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/NewACDSAudio-pas.html">NewACDSAudio</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_AAC-pas.html">ACS_AAC</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Utility Units</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile><a href="../../../src/ACS_Misc-pas.html">ACS_Misc</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_Procs-pas.html">ACS_Procs</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/acs_reg-pas.html">ACS_Reg</a></div></div><div class=MEntry><div class=MFile><a href="../../../src/ACS_Types-pas.html">ACS_Types</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent4')">Tutorials</a><div class=MGroupContent id=MGroupContent4><div class=MEntry><div class=MFile id=MSelected>Audio Processor</div></div><div class=MEntry><div class=MFile><a href="../ComponentsDemo/ComponentsDemo-pas.html">Components Demo</a></div></div><div class=MEntry><div class=MFile><a href="../../Recorders-rippers/Rip'n'listen/Main-pas.html">Rip&rsquo;n&rsquo;Listen Demo</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="../../../dunit/dunit/Test_ACS_MAC-pas.html">ACS_MAC TestCases</a></div></div><div class=MEntry><div class=MFile><a href="../../../dunit/dunit/Test_ACS_WavPack-pas.html">ACS_WavPack TestCases</a></div></div><div class=MEntry><div class=MFile><a href="../../../dunit/dunit/Test_ACS_FLAC-pas.html">TestFLACEncode</a></div></div><div class=MEntry><div class=MFile><a href="../../../dunit/dunit/uLog-pas.html">uLog.pas</a></div></div><div class=MEntry><div class=MFile><a href="../../../dunit/dunit/uTestBase-pas.html">uTestBase</a></div></div><div class=MEntry><div class=MFile><a href="../../../dunit/dunit/uUtility-pas.html">uUtility</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent5')">Index</a><div class=MGroupContent id=MGroupContent5><div class=MEntry><div class=MIndex><a href="../../../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../../../index/Constants.html">Constants</a></div></div><div class=MEntry><div class=MIndex><a href="../../../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../../../index/Properties.html">Properties</a></div></div><div class=MEntry><div class=MIndex><a href="../../../../index/Types.html">Types</a></div></div><div class=MEntry><div class=MIndex><a href="../../../../index/Variables.html">Variables</a></div></div><div class=MEntry><div class=MIndex><a href="../../../../index/Files.html">Files</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Constants">Constants</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Properties">Properties</option><option value="Types">Types</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([4, 5, 3], 6);// --></script></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>procedure TForm1.FormClose(</td><td class=PParameter nowrap>Sender:</td><td class=PType nowrap>&nbsp;TObject;</td></tr><tr><td></td><td class=PParameter nowrap>var Action:</td><td class=PType nowrap>&nbsp;TCloseAction</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>This OnClose event prevents exceptions if he form is closed while playing.</div></div><div class=CToolTip id="tt2"><div class=CSection>This tutorial will teach you how to write input and output components for the NewAC components suite. </div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>